require('../styles/base.less');
require('../styles/index.less');

// import $ from 'jQuery';
import xtag from 'xtag';
import MyThumb from './mythumb.js';

/*// import $ from '../lib/jQuery/dist/jquery.min.js';
// import SystemJS from '../lib/system.js/dist/system.js';
import xtag from '../lib/x-tag-core/dist/x-tag-core.min.js';
import MyThumb from './mythumb.js';*/

// export default function() {
  xtag.register('x-foo', {
    content: `<div class="main">
  <img id="thumb" src="../imgs/thumb.png">
  <span id="addOne" class="none">+1</span>
</div>`,
    events: {
      click: function(e) {
        console.log(e);
        if (e.target.id == 'thumb') {
          const thumbIns = new MyThumb($('#thumb'), $('#addOne'));
          thumbIns.clickEvent();
        }
      }
    }
  });
//}
/*
SystemJS.config({
    baseURL: '../scripts/'
});
(function($, MyThumb) {
  function callback($) {
      var f = new $.thumbUp($('#thumb'), $('#addOne'));
      f.clickEvent();
  }
  SystemJS.import('../scripts/mythumb.js').then(function(m) {
      $.extend({
          thumbUp: m.default.MyThumb
      });
      callback($);
  });
  
})($, MyThumb);*/